package sheji.jianZao.gongChangFangfa;

public class ConcreteCreator implements Creator {

    @Override
    public <T extends Product> T factory(Class<T> clazz) {
        Product product = null;
        try {
            product = (Product) Class.forName(clazz.getName()).newInstance();
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return (T) product;
    }
}
